<template>
  <div>
     <el-menu
     default-active="0"
      class="el-menu-vertical-demo"
      @open="handleOpen"
      @close="handleClose">
      <el-menu-item index="0" @click="toYun('/Yun')">
        <i class="el-icon-s-home"></i>
        <span slot="title">运营总览</span>
      </el-menu-item>
     <el-submenu index="1">
        <template slot="title">
          <i class="el-icon-s-shop"></i>
          <span>招商管理</span>
        </template>
        <el-menu-item-group>
          <el-menu-item index="1-1" @click="toContracts('/Contracts')">合同订单管理</el-menu-item>
          <el-menu-item index="1-2" @click="toCustomer('/Customer')">客户信息管理</el-menu-item>
        </el-menu-item-group>
      </el-submenu>
      <el-submenu index="2">
        <template slot="title">
          <i class="el-icon-s-custom"></i>
          <span>租户管理</span>
        </template>
        <el-menu-item-group>
          <el-menu-item index="2-1" @click="toEnterprise('/Enterprise')">租户信息管理</el-menu-item>
          <el-menu-item index="2-2" @click="toStaffs('/Staffs')">租户人员管理</el-menu-item>
        </el-menu-item-group>
      </el-submenu>
      <el-submenu index="3">
        <template slot="title">
          <i class="el-icon-s-finance"></i>
          <span>资产管理</span>
        </template>
        <el-menu-item-group>
          <el-menu-item index="3-1" @click="toBuilding('/Building')">楼宇信息管理</el-menu-item>
          <el-menu-item index="3-2" @click="toPublicResource('/PublicResource')">公共资源管理</el-menu-item>
        </el-menu-item-group>
      </el-submenu>
      <el-submenu index="4">
        <template slot="title">
          <i class="el-icon-s-order"></i>
          <span>账单管理</span>
        </template>
        <el-menu-item-group>
          <el-menu-item index="4-1" @click="toCarpay('/Carpay')">车辆缴费账单</el-menu-item>
        </el-menu-item-group>
      </el-submenu>
    </el-menu>
  </div>
</template>

<script>
import Building from './Building.vue';
import PublicResource from './PublicResource.vue';
export default {
  components:{Building,PublicResource},
  data() {
    return {

    };
  },
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
      this.Building=true;
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
    toCarpay(path){
      this.$router.push(path);
    },
    toBuilding(path){
      this.$router.push(path);
    },
    toPublicResource(path){
      this.$router.push(path);
    },
    toContracts(path) {
      this.$router.push(path);
    },
    toEnterprise(path) {
      this.$router.push(path);
    },
    toCustomer(path){
      this.$router.push(path);
    },
    toStaffs(path){
      this.$router.push(path);
    },
    toYun(path){
      this.$router.push(path);
    },

  }


};
</script>
